{include file="page_header.lbi"}
<div id="col1">{include file="page_sidebar.lbi"}</div>
<div id="col2">
<div class="location">修改角色</div>

<form action="{$r}role/edit" method="post" name="editform">
<table class="bd_c_1" cellpadding="0" cellspacing="0">
		<tr>
			<td><label>角色修改:</label><input type="text" name="name" value="{$rsInfo.name}" size=64/><input type="submit" name="rsubmit" value="修改" class="buttons_a"/></td>
		</tr>

		{if $permInfo->perm == "0"}
			<tr>
				<td><label>功能选择:</label><select name='resource' onchange='if(this.value=="1")document.getElementById("res_area").style.display="";else document.getElementById("res_area").style.display="none";'><option value='0'>全部</option><option value="1">选择</option></select></td>
			</tr>
			<tr id="res_area" style='display:none'>
				<td>
					{foreach from=$res key=i item=item}
						<input id="{$i}" type="checkbox" name="role[]" value="{$item.name}"><label for="{$i}">{$item.name}</label>
					{/foreach}
				</td>
			</tr>
		{else}
			<tr>
				<td><label>功能选择:</label><select name='resource' onchange='if(this.value=="1")document.getElementById("res_area").style.display="";else document.getElementById("res_area").style.display="none";'><option value='0'>all</option><option value="1" selected>选择</option></select></td>
			</tr>
			<tr id="res_area" style='display:block'>
				<td>
					{foreach from=$res key=i item=item}
							{if $permInfo->perm|strpos:$item.name eq false}
								<input id="{$i}" type="checkbox" name="role[]" value="{$item.name}"><label for="{$i}" >{$item.name}</label>
							{else}
								<input id="{$i}" type="checkbox" name="role[]" value="{$item.name}" checked><label for="{$i}" >{$item.name}</label>
							{/if}
					{/foreach}
				</td>
			</tr>		
		{/if}
		<tr><label>{$msgRole}</label></tr>
	</table>
	<input type="hidden" name="id" value="{$rsInfo.rid}"/>
</form>
</div>
{include file="page_footer.lbi"}